home *** CD-ROM | disk | FTP | other *** search
- //
- // Example of using symbols and multiline macros
- // to cascade filters without having to specify
- // each delay line address. The macros keep track
- // of the current delay line address using the
- // symbol "addr".
- //
- // Bill Gardner, March, 1993.
- //
-
- #macro do_input(src)
- set("addr", 0);
- move(src, addr)
- #endm
-
- #macro do_output(dest)
- move(addr, dest)
- #endm
-
- #macro do_comb(delay, gain)
- comb(addr, addr+delay, gain);
- set("addr", addr+delay)
- #endm
-
- #macro do_delay(delay)
- set("addr", addr+delay)
- #endm
-
- //
- // Cascade a 1000 sample comb filter with a 500
- // sample delay.
- //
- do_input(Lin);
- do_comb(4000, 0.5);
- do_delay(500);
- do_output(Lout);
-